<?php
$url = "http://qt.gtimg.cn/?q=s_usAIH";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);//设置请求地址
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
$arr=explode('~',$json);
pre($arr);
$tmpArr=array(
    array('EStock Name','NASDAQ GS'),//Exchange
    array('Stock Code',$arr[2]),
    array('Price','$'.$arr[3]),
    array('Change',$arr[4]."({$arr[5]}%)"),
    array('Volume',number_format($arr[6])),
    //array("Today's Open","$9.86"),//9.86
    //array("Previous Close","$9.94"),//9.94
    //array('Intraday High',"$9.90"),//9.90
    //array('Intraday Low',"$9.04"),//9.04
    //array('52 Week High',"$11.24"),//11.24
    //array('52 Week Low',"$3.81"),//3.81
    array('Turnover',number_format($arr[7])),
    array('Market Value',$arr[8]),
    //'date'=>array('Data as of Jun 4, 2021 4','00 PM EDT'),
);
pre($tmpArr);
echo json_encode($tmpArr);
exit;

function pre($data){
    echo "<pre>";
    print_r($data);
    echo "</pre>";
}
